home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DATATYPE.SWG / 0017_Moving Number Data.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  537b  |  24 lines

  1. {
  2. To shift a LongInt or Pointer into another Word do this..
  3.  
  4. The HoBitsToShift is the number of Bits you want to move
  5. the way i did it you get the upper half of the LongInt first...
  6. }
  7.  
  8. Function Shitftit(Var MyLongInt : LongInt) : Word;
  9. Var
  10.   Count  : Byte;
  11.   TShift : Word;
  12. Begin
  13.   TShift := 0;
  14.   For Count := 1 to HowBitsToShift Do
  15.   Begin
  16.     Tshit := (Tshit Shl 1);
  17.     If MyLongInt and $80000000 <> 0 Then
  18.       TShift := (TShift or $01);
  19.     MyLongInt := (MyLongInt Shl 1);
  20.   End;
  21.   ShiftIt := TShift;
  22. End;
  23.  
  24.